package com.community.process._1010.domains;

import com.community.process._1010.common.api.InPage;
import com.community.process._1010.dao.entity.ProcessCategory;
import com.oneadds.lowcode.BaseQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;

/**
 * @Description:
 * @Author: Administrator to Zbs
 * @Date: 2024/9/6 星期五 13:13
 */
public class ProcessCategoryDTO implements Serializable {

    @Getter
    @Setter
    @Schema(description = "类目查询")
    public static class CategoryPageSearch extends InPage {
        @Schema(description = "父类目ID")
        private Long parentId;
        @Schema(description = "类目编码")
        private String treeCode;
        @Schema(description = "分类类型 1 食材 2 菜品")
        private String type;
    }

    @Getter
    @Setter
    @Schema(description = "类目")
    static class CategoryBase {
        @Schema(description = "类目名称",requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "类目名称不能为空")
        private String name;

        @Schema(description = "图标")
        private String icon;

        @Schema(description = "排序")
        private Integer sort;

        @Schema(description = "分类类型 1 食材 2 菜品")
        @NotBlank(message = "分类类型不能为空")
        private Integer type;
    }

    @Schema(description = "类目添加")
    @Getter
    @Setter
    public static class CategoryAdd extends CategoryBase {
        /**
         * 上级ID
         */
        @Schema(description = "上级ID")
        private Long parentId;
    }

    @Getter
    @Setter
    public static class CategoryUpdate extends CategoryBase {
        /**
         * ID
         */
        @Schema(description = "ID",requiredMode = Schema.RequiredMode.REQUIRED)
        private Long id;
    }

    @Getter
    @Setter
    public static class CategoryDelete {
        /**
         * ID
         */
        @Schema(description = "ID",requiredMode = Schema.RequiredMode.REQUIRED)
        @NotEmpty(message = "ID不能为空")
        private List<Long> ids;
    }
}
